package com.chuzhiyun.chengguoxy.feature.welcome;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;

import com.chuzhiyun.chengguoxy.MainActivity;
import com.chuzhiyun.chengguoxy.databinding.ActivityMainBinding;
import com.chuzhiyun.chengguoxy.databinding.ActivityWelcomeBinding;
import com.chuzhiyun.chengguoxy.feature.base.BaseActivity;
import com.chuzhiyun.chengguoxy.feature.home.HomeActivity;
import com.chuzhiyun.chengguoxy.feature.login.LoginActivity;
import com.chuzhiyun.chengguoxy.global.Config;
import com.chuzhiyun.chengguoxy.utlis.StringUtils;
import com.vondear.rxtool.RxSPTool;
import com.vondear.rxtool.RxTextTool;

public class WelcomeActivity extends BaseActivity<ActivityWelcomeBinding> {

    @Override
    public void initView(View view) {
        try {
            String token = RxSPTool.getString(WelcomeActivity.this, Config.SP_TOKEN);
            if (TextUtils.isEmpty(token)){
                Intent intent =new Intent(WelcomeActivity.this,LoginActivity.class);
                startActivity(intent);
            }else {
                Intent intent =new Intent(WelcomeActivity.this, HomeActivity.class);
                startActivity(intent);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @Override
    public void initData() {

    }

    @Override
    public void setListener() {

    }

    @Override
    protected ActivityWelcomeBinding getViewBinding() {
        return ActivityWelcomeBinding.inflate(getLayoutInflater(), baseBinding.getRoot(), true);
    }
}